@use 'sass:meta';
@use '_mixins.scss';

.stream {
    position: relative;
    float: left;
    width: calc(100% - 345px);
    height: 100%;
    background: #222;

    &.full { width: 100%; }

    &.hovered ~ .stream-controls,
    &.hovered ~ .sidebar-controls,
    &.hovered ~ .recording-control { bottom: 0; }
    &.hovered .stream-head { top: 0; }

    @include meta.load-css('_participantsNotice.scss');
    @include meta.load-css('_participantsBlock.scss');

    &-wrapper{
        display: grid;
        position: relative;
        width: calc(100% - 32px);
        height: calc(100% - 160px);
        margin: 0 auto;
        padding-top: 64px;
        padding-bottom: 96px;

        &.with-participants-block {
            float: left;
            width: calc(100% - 310px);

            @include mixins.small-screen {
                width: calc(100% - 230px);
            }
        }
    }

    &-container {
        margin: auto;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;

        &.single-stream {
            height: 100%;
            @media only screen and (max-width: 900px) { height: auto; }
        }

        &.dual-stream {
            height: 60%;
            @media only screen and (max-width: 1100px) { height: auto; }
        }
    }

    .with-notice {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: auto;
        z-index: 11;
    }

    //
    // Alert
    // --------------------------------------------------------------------

    .alert {
        position: absolute;
        bottom: 10px;
        left: 10px;
        padding: 10px;
        border-radius: 4px;
        background: #07BFA5;
        color: #FFF;

        &-content {
            float: left;

            span {
                display: block;
                float: left;
                padding: 0 4px 0 0;

                &:first-child { font-weight: bold; }
            }
        }

        &-control {
            float: left;
            margin: 0 0 0 20px;
            padding: 0 0 0 10px;
            border-left: 1px solid #FFF;
        }

        button {
            width: 15px;
            height: 15px;
            padding: 0;
            border: 0 none;
            border-radius: 200px;
            text-indent: -9999px;
            background: #FFF;
            cursor: pointer;
        }
    }

    .stream-on-hold {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font: var(--text-h2);
        color: var(--secondary-white);
        text-align: center;
        cursor: pointer;

        i {
            display: block;
            margin: 0 auto;
            --icon-size: 80px;
            --mask-color: var(--surface-grey-1);
        }

        span {
            font: var(--text-h3);
            color: var(--secondary-white);
        }
    }

    .call-overlay {
        background: rgba(0, 0, 0, 0.32);
        height: 100%;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 10;
    }

    .on-hold-overlay {
        z-index: 10;
        width: 100%;
        height: 100%;
        position: absolute;
        background: rgba(0, 0, 0, 0.7);
        top: 0;
        left: 0;
    }
}

//
// Carousel
// --------------------------------------------------------------------

.carousel {
    float: left;
    height: 100%;

    @include mixins.small-screen {
        float: right;
    }

    &-container {
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;

        .carousel-page {
            display: none;
            position: absolute;
            top: 0;
            width: 100%;
            height: 100%;
            margin: auto;
            transition: transform 500ms, opacity 800ms, z-index 500ms;

            &.active {
                position: relative;
                display: flex;
                flex-wrap: wrap;
                justify-content: center;
                z-index: 900;
            }
        }
    }
}

.stream-toast {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 100px;
    width: 100%;
    z-index: 20;

    &-content {
        display: flex;
        align-items: center;
        width: 430px;
        padding: 14px;
        border-radius: 16px;
        box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.3);
        background: var(--surface-main);

        .stream-toast-icon {
            --icon-size: 20px;
        }

        .stream-toast-message {
            padding: 0 14px 0;
            color: var(--text-color-high);
        }

        .stream-toast-close {
            --icon-size: 20px;
            justify-content: center;
        }
    }
}
